on open fileDropList
	set theCount to count of fileDropList
	set filesProcessed to 0
	tell application "MacGS-510 FAT" to activate
	repeat with i from 1 to theCount
		set theFile to item i of fileDropList as alias
		set theInfo to info for theFile
		set theType to file type of theInfo
		set theFileName to item i of fileDropList as string
		if theType = "TEXT" or theType = "EPSF" then
			ProcessFiles(theFileName)
			set filesProcessed to filesProcessed + 1
		end if
	end repeat
	if filesProcessed > 0 then
		if filesProcessed is equal to 1 then
			set resultString to "One file was processed."
		else
			set resultString to {theCount, " files were processed."} as string
		end if
	else
		set resultString to {"No files were processed."} as string
	end if
	display dialog resultString buttons "OK" with icon 1 default button 1
end open

on ProcessFiles(theFile)
	set thePDFfile to {theFile, ".pdf"} as string
	set theCommandLine to {"-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\"", thePDFfile, "\" -c save pop -f \"", theFile, "\""} as string
	tell application "MacGS-510 FAT"
		Çevent gsVRexecÈ theCommandLine
	end tell
	
end ProcessFiles

on run
	set theFile to (choose file of type {"TEXT", "EPSF"}) as string
	ProcessFiles(theFile)
end run
